// components/menuItem/menuItem.ts
import{tapAnimation}from"../../utils/animations";

Component({

  /**
   * 组件的属性列表
   */
  properties: {
    id:{
      type:String
    },
    item: {
      "type": Object,
      "value": {
        
        imageUrl: "https://tse4-mm.cn.bing.net/th/id/OIP-C.TlcARrTXvRPArrYZlYSc3gHaE8?w=195&h=195&c=7&r=0&o=5&dpr=2&pid=1.7",
        title: "示例菜品",
        comment: 3,
        site: "一饭三楼",
        price: 12.00
      }
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    animations:{
      foodItem:{}
    }
  },

  /**
   * 组件的方法列表
   */
  methods: {
    clickMenuItem(e) {
      this.setData({
        "animations.foodItem":tapAnimation()
      })
      wx.navigateTo({
        url: '/pages/foodDetail/foodDetail?id='+this.id,
      })
    }
  }
})